home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -serious- / workbench / mvtime / source / crono.amos / crono.amosSourceCode < prev   
AMOS Source Code  |  1999-12-06  |  4KB  |  133 lines

  1. Rem ***************************************************************
  2. Rem *  
  3. Rem * Crono My Time: a simple timer with an Arexx port 
  4. Rem *  
  5. Rem * v 1.0 - 27/11/1999 First pubblic release 
  6. Rem *
  7. Rem * ï¿½ Vettorello Marco 1999
  8. Rem *
  9. Rem * You can use it at your own risk! I'm not responsable of any
  10. Rem * damage arising from the use/abuse/misuse of this software!!
  11. Rem * You can change the code BUT you MUST give credits to me
  12. Rem * Permission is allowed only to use or adapt this code only
  13. Rem * for FREEWARE software
  14. Rem *
  15. Rem * Suggestion: try to procedure it in order to save space.  
  16. Rem *
  17. Rem ***************************************************************    
  18.  
  19. 'Load "AMOSPro_System:My_Program/_MISC/crono.abk",20 
  20.  Extension_24_0080 1
  21.  Extension_24_02C8 
  22.  Extension_24_03D6 
  23.  Extension_24_0018 1,1,20
  24.  Extension_24_0402 1," ","Crono my time ï¿½ 1999 Vettorello Marco. Freeware"
  25. If Arexx Exist("MVTIME")
  26.    A= Extension_24_0150("Message","MVTIME IS ALREADY RUNNING"+Chr$(10)+"THERE CAN BE ONLY ONE COPY RUNNING!!","ARGH!!")
  27.    End 
  28. End If 
  29. Arexx Open "MVTIME"
  30.  
  31. Do 
  32.    GW= Extension_24_0034 
  33.    If GW=-1
  34.       Exit 
  35.    End If 
  36.    If GW=1
  37.       Rem reset
  38.       _READY$="0:0:0"
  39.        Extension_24_009E 1,0,0,Varptr(_READY$)
  40.    End If 
  41.    If GW=2
  42.       FIRS$= Extension_10_02C4 : Rem acquisiamo che ore sono adesso 
  43.       HF=Val(Left$(FIRS$,2))
  44.       MF=Val(Mid$(FIRS$,3,2))
  45.       SF=Val(Right$(FIRS$,2))
  46.       DS=60-SF
  47.       DM=60-MF
  48.       DH=24-HF
  49.        Extension_24_0402 1,"Running","Crono my time ï¿½ 1999 Vettorello Marco. Freeware"
  50.       While Extension_24_0484 <>2
  51.           Extension_24_08C4 50
  52.          NOW$= Extension_10_02C4 
  53.          HN=Val(Left$(NOW$,2))
  54.          MN=Val(Mid$(NOW$,3,2))
  55.          SN=Val(Right$(NOW$,2))
  56.          If SN<SF
  57.             SS$=Str$(SN+DS)-" "
  58.             MN=MN-1
  59.          Else 
  60.             SS$=Str$(SN-SF)-" "
  61.          End If 
  62.          If MN<MF
  63.             MM$=Str$(MN+DM)-" "
  64.          Else 
  65.             MM$=Str$(MN-MF)-" "
  66.          End If 
  67.          If HN<HF
  68.             HH$=Str$(HN+DH)-" "
  69.          Else 
  70.             HH$=Str$(HN-HF)-" "
  71.          End If 
  72.          _T$=(HH$+":"+MM$+":"+SS$)-" "
  73.           Extension_24_009E 1,0,0,Varptr(_T$)
  74.       Wend 
  75.        Extension_24_0402 1,"Stopped","Crono my time ï¿½ 1999 Vettorello Marco. Freeware"
  76.    End If 
  77.    If GW=-10
  78.       If Arexx=2
  79.          CMD$=Arexx$(0)
  80.          CMD$= Extension_10_0520(1,CMD$)
  81.          If CMD$="start"
  82.             Arexx Answer 0,"start"+Chr$(0)
  83.             FIRS$= Extension_10_02C4 
  84.             HF=Val(Left$(FIRS$,2))
  85.             MF=Val(Mid$(FIRS$,3,2))
  86.             SF=Val(Right$(FIRS$,2))
  87.             DS=60-SF
  88.             DM=60-MF
  89.             DH=24-HF
  90.              Extension_24_0402 1,"Running","Crono my time ï¿½ 1999 Vettorello Marco. Freeware"
  91.             While Extension_24_0484 <>-10 and Arexx<>2 and Arexx$(0)<>"stop"
  92.                 Extension_24_08C4 50
  93.                NOW$= Extension_10_02C4 
  94.                HN=Val(Left$(NOW$,2))
  95.                MN=Val(Mid$(NOW$,3,2))
  96.                SN=Val(Right$(NOW$,2))
  97.                If SN<SF
  98.                   SS$=Str$(SN+DS)-" "
  99.                   MN=MN-1
  100.                Else 
  101.                   SS$=Str$(SN-SF)-" "
  102.                End If 
  103.                If MN<MF
  104.                   MM$=Str$(MN+DM)-" "
  105.                Else 
  106.                   MM$=Str$(MN-MF)-" "
  107.                End If 
  108.                If HN<HF
  109.                   HH$=Str$(HN+DH)-" "
  110.                Else 
  111.                   HH$=Str$(HN-HF)-" "
  112.                End If 
  113.                _T$=(HH$+":"+MM$+":"+SS$)-" "
  114.                 Extension_24_009E 1,0,0,Varptr(_T$)
  115.             Wend 
  116.             Arexx Answer 0,Chr$(0)
  117.              Extension_24_0402 1,"Stopped","Crono my time ï¿½ 1999 Vettorello Marco. Freeware"
  118.          Else If CMD$="reset"
  119.             _READY$="0:0:0"
  120.              Extension_24_009E 1,0,0,Varptr(_READY$)
  121.             Arexx Answer 0,"reset"+Chr$(0)
  122.          Else If CMD$="quit"
  123.             Arexx Answer 0,"bye"+Chr$(0)
  124.             Exit 
  125.          Else 
  126.             Arexx Answer 0,"No such command!"+Chr$(0)
  127.          End If 
  128.       End If 
  129.    End If 
  130. Loop 
  131.  Extension_24_0130 
  132. Arexx Close 
  133. End